<template>
    <div class="container">
        <el-row>
            <el-col :span="16" :offset="4">
                <el-row class="navbar">
                    <el-col>
                    <el-breadcrumb separator-class="el-icon-arrow-right">
                         <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
                        <el-breadcrumb-item :to="{ path: '/contact' }">联系我们</el-breadcrumb-item>
                    </el-breadcrumb>
                    </el-col>
                    <el-col>
                    <p></p>
                    </el-col>
                </el-row>
                
                <el-row class="ditu">
                    <el-col>
                        <iframe src="https://map.sogou.com/#s=m&c=12114702.1484375,4043571.2890625,18" style="border:0;width:100%;min-height:500px" allowfullscreen=""></iframe>
                    </el-col>
                </el-row>
                <el-row :gutter="25">
                    <el-col :span="12" class="corporation">
                        <h2>西安xxxx有限公司</h2>
                        <p>
                            <i class="el-icon-phone-outline"> &nbsp;</i><a href="tel:+18398098978">18398098978</a> 客服电话
                        </p>
                        <p>
                            <i class="el-icon-message"> &nbsp;</i><a href="mailto:kf@abcditc.com">kf@abcditc.com</a> 客服邮箱
                        </p>
                        <p>
                            <i class="el-icon-location-outline"> </i> 西安市西咸新区沣东新城三桥街道金桥国际
                        </p>
                    </el-col>
                    <el-col :span="12">
                        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
                            <el-form-item label="您的称呼" prop="name">
                                <el-input v-model="ruleForm.name" placeholder="输入您的称呼" ></el-input>
                            </el-form-item>
                            <el-form-item label="联系方式" prop="tel">
                                <el-input v-model="ruleForm.name" placeholder="输入您的联系方式" ></el-input>
                            </el-form-item>
                            <el-form-item label="意见留言" prop="msg">
                                <el-input type="textarea" placeholder="输入您的建议或意见" v-model="ruleForm.desc" rows="6"></el-input>
                            </el-form-item>
                            <el-form-item>
                                <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
                                <el-button @click="resetForm('ruleForm')">重置</el-button>
                            </el-form-item>
                        </el-form>
                    </el-col>
                </el-row>
            </el-col>
        </el-row>
    </div>
</template>

<script>
export default {
    name:'contact',
    data(){
        return{
            ruleForm: {
                name: '',
                tel: '',
                msg: ''
            },
            rules: {
            name: [
                { required: true, message: '请输入您的称呼', trigger: 'blur' },
                { min: 2, max: 5, message: '长度在 2 到 5 个字符', trigger: 'blur' }
            ],
            tel: [
                { required: true, message: '请输入您的联系方式', trigger: 'blur' }
            ],
            msg: [
                { required: true, message: '请填写您的建议或者意见', trigger: 'blur' }
            ]
            }
        };
    },
    methods:{
        submitForm(formName) {
        this.$refs[formName].validate((valid) => {
            if (valid) {
                alert('submit!');
            } else {
                return false;
            }
            });
        },
        resetForm(formName) {
            this.$refs[formName].resetFields();
        }
    }
}
</script>

<style lang="scss" scoped>
.container{
    .navbar{
        margin: 20px 0px;
        p{
        height: 10px;
        border-bottom: 2px solid #ccc;
        }
        
    }
    .ditu{
        margin: 25px auto;
    }
    .corporation{
        display: flex;
        flex-direction:column;
        align-items: center;
        line-height: 200px;
    }
}
</style>